package ipc.project;

import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ScreenAddStatus extends Activity implements OnClickListener {
	
	public Context context = this;
	private User user;
	
	TextView txtStatus;
	Button btnAddStatus;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.add_status_screen);
		user=((App)getApplication()).getUser();
		
		txtStatus = (TextView) findViewById(R.id.textNewStatus);

		btnAddStatus = (Button) findViewById(R.id.buttonAddStatus);
		btnAddStatus.setOnClickListener(this);
	}

	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.buttonAddStatus:
			String newStatus=txtStatus.getText().toString();
			if(newStatus.length()>0){
				user.addStatus(newStatus);
				startActivity(new Intent(context, ScreenChooseStatus.class));
				finish();}
			break;
		}

	}
}
